package com.dhl.fin.api.enums;

import com.dhl.fin.api.service.messageService.*;
import com.dhl.fin.api.service.messageService.superService.RemindSendMessageService;
import lombok.Getter;

/**
 * @author CuiJianbo
 * @since 2025/5/7
 */
@Getter
public enum RemindTypeEnum {

    BIRTH("icon2.png", "生日", 1, BirthdayMessage.class),

    MEMORY_DATE("icon1.png", "纪念日", 2, MemoryDateMessage.class),

    MENSTRUATION("icon8.png", "生理期", 3, MenstruationMessage.class),

    LOAN("icon10.png", "贷款还款", 4, LoanMessage.class),

    CAR("icon4.png", "汽车保养", 5, CarMessage.class),

    FOOD("icon5.png", "食品到期", 6, FoodMessage.class),

    OTHER("icon7.png", "其他事项", 7, OtherMessage.class);

    private String code;
    private String name;
    private Integer sort;
    private Class<? extends RemindSendMessageService> messageTemplateClass;

    RemindTypeEnum(String code, String name, Integer sort, Class<? extends RemindSendMessageService> messageTemplate) {
        this.code = code;
        this.name = name;
        this.sort = sort;
        this.messageTemplateClass = messageTemplate;
    }

    public static RemindTypeEnum getIconByName(String name) {
        RemindTypeEnum[] values = RemindTypeEnum.values();
        for (RemindTypeEnum value : values) {
            if (value.name.equals(name)) {
                return value;
            }
        }
        return null;
    }
}
